﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace DynamicChart.UI
{
    public partial class ChartPartDecorator : UserControl, IChartPart
    {
        public event EventHandler Enter;

        public ChartPartDecorator()
        {
            InitializeComponent();
        }

        public void SetChartData(ServiceRef.ChartData data)
        {
            this._ctlChart.SetChartData(data);

            this._ctlBtnEnter.Visibility = System.Windows.Visibility.Visible;
        }

        private void _ctlBtnEnter_Click(object sender, RoutedEventArgs e)
        {
            if (Enter != null)
            {
                Enter(this, null);
            }
        }

        public void IsBusy()
        {
            this._ctlBtnEnter.Visibility = System.Windows.Visibility.Collapsed;
            this._ctlChart.IsBusy();
        }
    }
}
